<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>构造函数创建对象</title>
</head>
<body>
    <script>
       function Goods(name,price,count){
          this.name=name
          this.price=price
          this.count=count
       }
       const xiaomi=new Goods('小米',1999,20)
       const huawei=new Goods('华为',3999,59)
       const vivo=new Goods('vivo',1888,100)
       console.log(xiaomi)
       console.log(huawei)
       console.log(vivo)
       console.log(xiaomi===vivo)
       Goods.num=10
       console.log(Goods.num)
       Goods.sayHi=function(){
          console.log('Hello~~')
       }
    </script>
</body>
</html>